<div class="panel panel-default m-n">
    <div class="panel-heading">在线储值</div>
    <div class="panel-body">
        <form name="clientChargeForm" class="bs-example form-horizontal ng-pristine ng-valid"  ng-submit="charge()">
            <div class="form-group padder-md">
                <label>储值金额</label>
                <input type="number" class="form-control" placeholder="请填写储值金额" name="money" min="0.01" step="0.01"
                       ng-pattern="/^[0-9]+(.[0-9]{1,2})?$/" ng-model="clientCharge.chargeMoney" required>
                <div class="form-text" ng-if="clientChargeForm.money.$touched">
                    <span class="text-danger" ng-if="clientChargeForm.money.$error.required">储值金额是必填的<br></span>
                    <span class="text-danger" ng-if="clientChargeForm.money.$error.min">提现金额不得低于最小值<br></span>
                    <span class="text-danger" ng-if="clientChargeForm.money.$error.pattern">储值金额最多保留两位小数</span>
                </div>
            </div>
            <div class="form-group padder-md">
                <div>
                    <div class="inline">
                        <label class="i-checks i-checks-sm m-b-none h6">
                            <input type="checkbox" ng-checked="clientCharge.isGiveIntegral==1" ng-click="clientCharge.isGiveIntegral=clientCharge.isGiveIntegral==1?0:1;"><i></i>
                        </label>
                        <p class="inline m-t-sm m-r-xs">赠送积分</p>
                    </div>
                    <div class="inline" ng-if=" clientCharge.isGiveIntegral==1">
                        <input type="number" min="1" step="1" class="inline w-xs form-control m-r-xs" name="integral" ng-model=" clientCharge.integral" required>
                        <p class="inline m-n">分</p>
                    </div>
                    <div class="form-text" ng-if="clientChargeForm.integral.$touched">
                        <span class="text-danger" ng-if="clientChargeForm.integral.$error.required">(赠送积分是必须填的)<br></span>
                        <span class="text-danger" ng-if="clientChargeForm.money.$error.min">(赠送积分不得低于最小值)</span>
                    </div>
                </div>
                <div>
                    <label class="i-checks i-checks-sm m-b-none h6">
                        <input type="checkbox" ng-checked=" clientCharge.isGiveCoupons==1" ng-click=" clientCharge.isGiveCoupons= clientCharge.isGiveCoupons==1?0:1;"><i></i>
                    </label>
                    <p class="inline m-t-sm">赠送优惠卷</p>
                    <div class="inline" ng-if=" clientCharge.isGiveCoupons==1">
                        <select class="form-control w-sm inline m-r-xs" name="coupons" ng-model="clientCharge.couponsId" required>
                            <option value="">请选择优惠卷</option>
                            <option ng-repeat="c in couponsList" value="{{c.id}}" >{{c.name}}</option>
                        </select>
                    </div>
                    <div class="block">
                        <div class="form-text" ng-if="clientChargeForm.coupons.$touched">
                            <span class="text-danger" ng-if="clientChargeForm.coupons.$error.required">(请您选择赠送的优惠券)</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-12 text-right padder-md">
                    <button type="submit" class="btn btn-sm btn-info" ng-disabled="clientChargeForm.$invalid">保存</button>
                    <div class="btn btn-sm btn-default" ng-click="cancel()">取消</div>
                </div>
            </div>
        </form>
    </div>
</div>

